//
//  ViewController.m
//  SandboxObjcDemo1
//
//  Created by 李煜 on 2024/4/19.
//

#import "ViewController.h"


@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //沙盒根目录
    NSString *homePath = NSHomeDirectory();
    //Document目录
    NSString *documentPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).firstObject;
    //library目录
    NSString *libraryPath = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES).firstObject;
    //caches目录
    NSString *cachesPath = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).firstObject;
    //preferences目录
    NSString *preferencesPath = NSSearchPathForDirectoriesInDomains(NSPreferencePanesDirectory, NSUserDomainMask, YES).firstObject;
    //application support目录
    NSString *applicationSupportPath = NSSearchPathForDirectoriesInDomains(NSApplicationDirectory, NSUserDomainMask, YES).firstObject;
    //temp目录
    NSString *tempPath = NSTemporaryDirectory();
    
    
    NSLog(@"%@:\n%@:\n%@:\n%@:\n%@:\n%@:\n",homePath,documentPath,libraryPath,cachesPath,preferencesPath,applicationSupportPath);
}
//https://www.jianshu.com/p/9a3532129adc
@end
